﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;
using Controller;

namespace Facade
{
    public class TypeKPIFacade
    {
        public string Save(TypeKPI Types)
        {
            TypeKPIController cont = new TypeKPIController();
            return cont.Save(Types);
        }

        public string Delete(TypeKPI Types)
        {
            TypeKPIController cont = new TypeKPIController();
            return cont.Delete(Types);
        }

        public string BeforeDelete(TypeKPI Types)
        {
            TypeKPIController cont = new TypeKPIController();
            return cont.BeforeDelete(Types);
        }

        public IList<TypeKPI> GetAll(string sSearch, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<TypeKPI> Types = new List<TypeKPI>();
            TypeKPIController cont = new TypeKPIController();
            Types = cont.GetAll(sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return Types;
        }

        public IList<TypeKPI> GetAllTypeKPIsByCategoryID(int CategoryKPIID, string sSearch, int PageNumber, int DataLength, int SortCol, string SortDirection, out int TotalData)
        {
            IList<TypeKPI> Types = new List<TypeKPI>();
            TypeKPIController cont = new TypeKPIController();
            Types = cont.GetAllTypeKPIsByCategoryKPIID(CategoryKPIID, sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return Types;
        }

        public TypeKPI GetTypeKPIByID(int ID)
        {
            TypeKPI Types = new TypeKPI();
            TypeKPIController cont = new TypeKPIController();
            Types = cont.GetTypeKPIByID(ID);
            return Types;
        }

        public TypeKPI GetTypeKPIByDescription(string Description, int CategoryID)
        {
            TypeKPI Types = new TypeKPI();
            TypeKPIController cont = new TypeKPIController();
            Types = cont.GetTypeKPIByDescription(Description, CategoryID);
            return Types;
        }
    }
}